import request from '@/utils/request'
export function listWarehouse(query) {
  return request({
    url: '/erp/warehouse/list',
    method: 'get',
    params: query
  })
}
// 新增仓库信息
export function addWarehouse(data) {
  return request({
    url: '/erp/warehouse/add',
    method: 'post',
    data: data
  })
}

// 查询仓库信息详细
export function getWarehouse(warehouseId) {
  return request({
    url: '/erp/warehouse/getInfo/' + warehouseId,
    method: 'get'
  })
}

// 修改仓库信息
export function updateWarehouse(data) {
  return request({
    url: '/erp/warehouse/update',
    method: 'put',
    data: data
  })
}


// 导入单位
export function uploadExcel(data) {
  return request({
    url: '/erp/warehouse/import',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data' // 显式声明内容类型
    }
  })
}

// 导出单位
export function exportExcel() {
  return request({
    url: '/erp/warehouse/export',
    method: 'get',
    responseType: 'blob',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  })
}
